Skip to content

Conversation

@ringabout
Copy link
Member

fixes #25251

enforce a copy if the arg is a deref of a lent pointer since the arg could be a temporary that will go out of scope

@Araq
Copy link
Member

Araq commented Nov 3, 2025

Doesn't this disable the very optimization we were after?

@ringabout
Copy link
Member Author

Well, in #24093, they asked for optimizations for deref refs

let a = new array[1000, byte]
block:
  for _ in cast[typeof(a)](a)[]:
    discard

@Araq
Copy link
Member

Araq commented Nov 3, 2025

Exactly.

@ringabout
Copy link
Member Author

This PR doesn't disable optimization for #24093, which doesn't use lent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression in 2.2.6: SIGBUS with iterator over const Table lookup - premature temporary destruction

3 participants